Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Cecil metadata importer #11377

Merged
merged 2 commits into from
May 15, 2023
Merged

Fix Cecil metadata importer #11377

merged 2 commits into from
May 15, 2023

Conversation

maxkatz6
Copy link
Member

@maxkatz6 maxkatz6 commented May 15, 2023

What does the pull request do?

XamlX PR kekekeks/XamlX#88

Cecil default metadata importer seem to have not that much sense adding IL references from the dependencies of different version instead of using local ones. So, we need to help it find the way,
In general, it seems like MetadataImporter must be redefined if developer has changed AssemblyResolver logic, as these must be synced.
See submodule changes for more details kekekeks/XamlX@e5254eb...c5d5d8b

What is the current behavior?

While building app in .NET 7 target with .NET 6 Avalonia (or .NET Core 2.1+ target with .NET Standard 2.0 Avalonia...).

Before Cecil+XAMLX:

image

After Cecil+XAMLX:

image

Duplicated references are from .NET 6.0 runtime (used in Avalonia assemblies APIs). But .NET 7.0 only is expected.

What is the updated/expected behavior with this PR?

Before Cecil+XAMLX: the same as it was.

After Cecil+XAMLX:

image

New IL references added, but all are of correct version used from target framework.

Fixed issues

Fixes #5456

@maxkatz6 maxkatz6 requested a review from kekekeks May 15, 2023 04:09
@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0034722-beta. (feed url: https://pkgs.dev.azure.com/AvaloniaUI/AvaloniaUI/_packaging/avalonia-all/nuget/v3/index.json) [PRBUILDID]

@kekekeks kekekeks enabled auto-merge May 15, 2023 06:13
@kekekeks kekekeks added this pull request to the merge queue May 15, 2023
Merged via the queue into master with commit 3aa881b May 15, 2023
@kekekeks kekekeks deleted the fix-cecil-metadata-importer branch May 15, 2023 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception when using Edit and Continue on Visual Studio 2019 for Windows
3 participants